<template>
  <div class="container border-topbottom">
    <div class="header">
      <span class="header-title">
        <span class="iconfont">&#xe866;</span>
        本周热门榜单
      </span>
      <span class="header-title-more">
        全部榜单
        <span class="icon-arrow iconfont">&#xe62d;</span>
      </span>
    </div>
    <ul class="list">
      <router-link class="list-item"
        v-for="item in hotSaleList"
        :key="item.id"
        tag="li"
        :to="`/detail/${item.id}`">
        <div class="img-wrapper">
          <img class="item-img" :src="item.imgUrl" :alt="item.title">
        </div>
        <div class="item-title">{{ item.title }}</div>
        <p class="item-price">
          <span class="price">
            ¥
            <em class="price-num">
              {{ item.price }}
            </em>
          </span>
          起
        </p>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeHotSale',
  props: {
    hotSaleList: Array
  }
}
</script>

<style lang="stylus" scoped>
@import '~styles/variables.styl'
@import '~styles/mixins.styl'
.container
  background #fff
  margin .2rem 0
  .header
    display: flex
    justify-content: space-between
    padding: 0.2rem
    .header-title
      font-size: 0.32rem
      .iconfont
        color #f2550b
    .header-title-more
      height: 0.32rem
      line-height: 0.32rem
      font-size: 0.24rem
      color: $grayTextColor
      .icon-arrow
        font-size: 0.24rem
  .list
    padding: 0 0.24rem
    overflow-x scroll
    white-space nowrap
    .list-item
      display inline-block
      text-align: center
      width: 2rem
      padding .06rem 0 .2rem
      margin-right .12rem
      .item-img
        width 100%
      .item-title
        margin-top .12rem
        ellipsis()
      .item-price
        line-height .36rem
        font-size .24rem
        .price
          color $highlightTextColor
          .price-num
            font-size .28rem
</style>
